<template>
  <div id="app">
    <h1>Vue2无缝轮播图组件</h1>
    <Carousel :items="carouselItems" :autoplay="false" autoplayInterval="3000">
      <template v-slot:default="{ item, active }">
        <div class="custom-card" :class="{ active: active }">
          <h3>{{ item.title }}</h3>
          <p>{{ item.description }}</p>
        </div>
      </template>
    </Carousel>
  </div>
</template>

<script>
import Carousel from "./components/Carousel.vue";

export default {
  name: "App",
  components: {
    Carousel,
  },
  data() {
    return {
      carouselItems: [
        { title: "卡片 1", description: "这是第一张卡片的描述内容" },
        { title: "卡片 2", description: "这是第二张卡片的描述内容" },
        { title: "卡片 3", description: "这是第三张卡片的描述内容" },
        { title: "卡片 4", description: "这是第四张卡片的描述内容" },
        { title: "卡片 5", description: "这是第五张卡片的描述内容" },
        { title: "卡片 6", description: "这是第六张卡片的描述内容" },
        { title: "卡片 7", description: "这是第七张卡片的描述内容" },
      ],
    };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

.custom-card {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.custom-card.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}
</style>
